import request from '@/utils/request'

// 获取所有权限  /sys/permission
export function getPermList(params) {
  return request({
    url: '/sys/permission'
  })
}

// 删除 /sys/permission/{id}
export function delPerm(id) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'delete'
  })
}

// 根据id获取  /sys/permission/{id}
export function getPermDetail(id) {
  return request({
    url: `/sys/permission/${id}`
  })
}

// 编辑   /sys/permission/{id}
export function editPerm(data) {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'put',
    data
  })
}

// 添加  /sys/permission
export function addPerm(data) {
  return request({
    url: '/sys/permission',
    method: 'post',
    data
  })
}
